[Unit]
Description=Minio
Documentation=https://docs.minio.io
Wants=network-online.target
After=network-online.target
AssertFileIsExecutable=/usr/local/bin/minio

[Service]
WorkingDirectory=/usr/local/
User={{ minio_arg.user }}
Group={{ minio_arg.user }}
PermissionsStartOnly=true
EnvironmentFile=-/etc/default/minio-T_{{ item }}
ExecStartPre=/bin/bash -c "[ -n \"${MINIO_VOLUMES}\" ] || echo \"Variable MINIO_VOLUMES not set\""
ExecStart=/usr/local/bin/minio server $MINIO_OPTS $MINIO_VOLUMES
Restart=on-failure
RestartSec=30s
StandardOutput=journal
StandardError=inherit
LimitNOFILE={{ minio_arg.ulimit_nofile}}
LimitNPROC={{ minio_arg.ulimit_nproc }}
TimeoutStopSec=0
KillSignal=SIGTERM
SendSIGKILL=no
SuccessExitStatus=0

[Install]
WantedBy=multi-user.target
